// (Physics: finding runway length) Given an airplane’s acceleration a and take-off 
// speed v, you can compute the minimum runway length needed for an airplane to 
// take off using the following formula:
// length = v^2/2a
// Write a program that prompts the user to enter v in meters/second (m/s) and the 
// acceleration a in meters/second squared (m/s2), and displays the minimum runway length.

import java.util.Scanner;

public class test212 {
    public static void main(String[] args) {
        // 创建Scanner对象用于读取输入
        Scanner input = new Scanner(System.in);
        
        // 提示用户输入起飞速度（米/秒）
        System.out.print("Enter the take-off speed (v) in m/s: ");
        double takeOffSpeed = input.nextDouble();
        
        // 提示用户输入加速度（米/秒²）
        System.out.print("Enter the acceleration (a) in m/s²: ");
        double acceleration = input.nextDouble();
        
        // 计算最小跑道长度：length = v² / (2a)
        double runwayLength = (takeOffSpeed * takeOffSpeed) / (2 * acceleration);
        
        // 显示结果，保留两位小数
        System.out.printf("The minimum runway length required is %.2f meters", runwayLength);
        
        // 关闭Scanner
        input.close();
    }
}
